def deco(x):
    print 'start deco', x
    def new_deco(func):
        print 'start new deco'
        def test(a,b):
            print 'test begin'
            ret = func(a,b)
            print 'test end'
            return ret
        print 'stop new deco'
        return test
    print 'stop deco', x
    return new_deco

@deco(3)
def mytest(x,y):
    if x > y:
        print x
    else:
        print y

mytest(1,5)
